/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - GLBgetPreguntasCursor0RS.as.
 */

package vo.glb
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.EventDispatcher;
import mx.collections.ArrayCollection;
import mx.events.PropertyChangeEvent;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_GLBgetPreguntasCursor0RS extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _GLBgetPreguntasCursor0RSEntityMetadata;
    model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();

    public function getChangedObjects() : Array
    {
        _changedObjects.addItemAt(this,0);
        return _changedObjects.source;
    }

    public function clearChangedObjects() : void
    {
        _changedObjects.removeAll();
    }

    /**
     * properties
     */
    private var _internal_Id : int;
    private var _internal_IdFicha : int;
    private var _internal_IdDimension : int;
    private var _internal_IdCategoria : int;
    private var _internal_IdTipo : int;
    private var _internal_Numero : int;
    private var _internal_NumeroCategoria : int;
    private var _internal_NumeroDimension : int;
    private var _internal_NumeroFicha : int;
    private var _internal_Nombre : String;
    private var _internal_NombreFicha : String;
    private var _internal_NombreDimension : String;
    private var _internal_NombreCategoria : String;
    private var _internal_EsRequerido : int;
    private var _internal_Factor : Number;
    private var _internal_Desactivado : int;

    private static var emptyArray:Array = new Array();

    // Change this value according to your application's floating-point precision
    private static var epsilon:Number = 0.0001;

    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_GLBgetPreguntasCursor0RS()
    {
        _model = new _GLBgetPreguntasCursor0RSEntityMetadata(this);

        // Bind to own data or source properties for cache invalidation triggering

    }

    /**
     * data/source property getters
     */

    [Bindable(event="propertyChange")]
    public function get Id() : int
    {
        return _internal_Id;
    }

    [Bindable(event="propertyChange")]
    public function get IdFicha() : int
    {
        return _internal_IdFicha;
    }

    [Bindable(event="propertyChange")]
    public function get IdDimension() : int
    {
        return _internal_IdDimension;
    }

    [Bindable(event="propertyChange")]
    public function get IdCategoria() : int
    {
        return _internal_IdCategoria;
    }

    [Bindable(event="propertyChange")]
    public function get IdTipo() : int
    {
        return _internal_IdTipo;
    }

    [Bindable(event="propertyChange")]
    public function get Numero() : int
    {
        return _internal_Numero;
    }

    [Bindable(event="propertyChange")]
    public function get NumeroCategoria() : int
    {
        return _internal_NumeroCategoria;
    }

    [Bindable(event="propertyChange")]
    public function get NumeroDimension() : int
    {
        return _internal_NumeroDimension;
    }

    [Bindable(event="propertyChange")]
    public function get NumeroFicha() : int
    {
        return _internal_NumeroFicha;
    }

    [Bindable(event="propertyChange")]
    public function get Nombre() : String
    {
        return _internal_Nombre;
    }

    [Bindable(event="propertyChange")]
    public function get NombreFicha() : String
    {
        return _internal_NombreFicha;
    }

    [Bindable(event="propertyChange")]
    public function get NombreDimension() : String
    {
        return _internal_NombreDimension;
    }

    [Bindable(event="propertyChange")]
    public function get NombreCategoria() : String
    {
        return _internal_NombreCategoria;
    }

    [Bindable(event="propertyChange")]
    public function get EsRequerido() : int
    {
        return _internal_EsRequerido;
    }

    [Bindable(event="propertyChange")]
    public function get Factor() : Number
    {
        return _internal_Factor;
    }

    [Bindable(event="propertyChange")]
    public function get Desactivado() : int
    {
        return _internal_Desactivado;
    }

    public function clearAssociations() : void
    {
    }

    /**
     * data/source property setters
     */

    public function set Id(value:int) : void
    {
        var oldValue:int = _internal_Id;
        if (oldValue !== value)
        {
            _internal_Id = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "Id", oldValue, _internal_Id));
        }
    }

    public function set IdFicha(value:int) : void
    {
        var oldValue:int = _internal_IdFicha;
        if (oldValue !== value)
        {
            _internal_IdFicha = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "IdFicha", oldValue, _internal_IdFicha));
        }
    }

    public function set IdDimension(value:int) : void
    {
        var oldValue:int = _internal_IdDimension;
        if (oldValue !== value)
        {
            _internal_IdDimension = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "IdDimension", oldValue, _internal_IdDimension));
        }
    }

    public function set IdCategoria(value:int) : void
    {
        var oldValue:int = _internal_IdCategoria;
        if (oldValue !== value)
        {
            _internal_IdCategoria = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "IdCategoria", oldValue, _internal_IdCategoria));
        }
    }

    public function set IdTipo(value:int) : void
    {
        var oldValue:int = _internal_IdTipo;
        if (oldValue !== value)
        {
            _internal_IdTipo = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "IdTipo", oldValue, _internal_IdTipo));
        }
    }

    public function set Numero(value:int) : void
    {
        var oldValue:int = _internal_Numero;
        if (oldValue !== value)
        {
            _internal_Numero = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "Numero", oldValue, _internal_Numero));
        }
    }

    public function set NumeroCategoria(value:int) : void
    {
        var oldValue:int = _internal_NumeroCategoria;
        if (oldValue !== value)
        {
            _internal_NumeroCategoria = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "NumeroCategoria", oldValue, _internal_NumeroCategoria));
        }
    }

    public function set NumeroDimension(value:int) : void
    {
        var oldValue:int = _internal_NumeroDimension;
        if (oldValue !== value)
        {
            _internal_NumeroDimension = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "NumeroDimension", oldValue, _internal_NumeroDimension));
        }
    }

    public function set NumeroFicha(value:int) : void
    {
        var oldValue:int = _internal_NumeroFicha;
        if (oldValue !== value)
        {
            _internal_NumeroFicha = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "NumeroFicha", oldValue, _internal_NumeroFicha));
        }
    }

    public function set Nombre(value:String) : void
    {
        var oldValue:String = _internal_Nombre;
        if (oldValue !== value)
        {
            _internal_Nombre = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "Nombre", oldValue, _internal_Nombre));
        }
    }

    public function set NombreFicha(value:String) : void
    {
        var oldValue:String = _internal_NombreFicha;
        if (oldValue !== value)
        {
            _internal_NombreFicha = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "NombreFicha", oldValue, _internal_NombreFicha));
        }
    }

    public function set NombreDimension(value:String) : void
    {
        var oldValue:String = _internal_NombreDimension;
        if (oldValue !== value)
        {
            _internal_NombreDimension = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "NombreDimension", oldValue, _internal_NombreDimension));
        }
    }

    public function set NombreCategoria(value:String) : void
    {
        var oldValue:String = _internal_NombreCategoria;
        if (oldValue !== value)
        {
            _internal_NombreCategoria = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "NombreCategoria", oldValue, _internal_NombreCategoria));
        }
    }

    public function set EsRequerido(value:int) : void
    {
        var oldValue:int = _internal_EsRequerido;
        if (oldValue !== value)
        {
            _internal_EsRequerido = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "EsRequerido", oldValue, _internal_EsRequerido));
        }
    }

    public function set Factor(value:Number) : void
    {
        var oldValue:Number = _internal_Factor;
        if (isNaN(_internal_Factor) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_Factor = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "Factor", oldValue, _internal_Factor));
        }
    }

    public function set Desactivado(value:int) : void
    {
        var oldValue:int = _internal_Desactivado;
        if (oldValue !== value)
        {
            _internal_Desactivado = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "Desactivado", oldValue, _internal_Desactivado));
        }
    }

    /**
     * Data/source property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _GLBgetPreguntasCursor0RSEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _GLBgetPreguntasCursor0RSEntityMetadata) : void
    {
        var oldValue : _GLBgetPreguntasCursor0RSEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }


}

}
